package demo.bean;

import java.io.Serializable;

public class Goods implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 3922725357862650288L;
	
	
	
	private Integer goodsId;
	private String name;
	private Double peice;
	private Integer number;
	
	public Goods(String name,Double price,Integer number)
	{
		this.name=name;
		this.number=number;
		this.peice=price;
	}
	
	
	
	
	public Integer getGoodsId() {
		return goodsId;
	}


	public void setGoodsId(Integer goodsId) {
		this.goodsId = goodsId;
	}

	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Double getPeice() {
		return peice;
	}
	public void setPeice(Double peice) {
		this.peice = peice;
	}
	public Integer getNumber() {
		return number;
	}
	public void setNumber(Integer number) {
		this.number = number;
	}
	
	
	@Override
	public int hashCode() {
		
		return this.name.hashCode();
	}


	@Override
	public boolean equals(Object obj) {
		Goods a=(Goods)obj;
		if(a.getName().equals(this.name))
		{
			return true;
		}
		return false;
	}




	@Override
	public String toString() {
		
		return "商品名字:"+this.name+" 商品数量:"+this.number+" 商品id:"+this.goodsId+"\n";
	}
	
	

}
